﻿@using System.Globalization
@using System.Threading
@using EveKillboard.Content
@model IEnumerable<EveKillboard.Core.Views.KillmailView>
@{
    var isKill = (bool)ViewData["isKill"];
    var week = CultureInfo.InvariantCulture.Calendar.GetWeekOfYear(DateTime.UtcNow.Date, CultureInfo.InvariantCulture.DateTimeFormat.CalendarWeekRule, CultureInfo.InvariantCulture.DateTimeFormat.FirstDayOfWeek);
}
<div class="content">
    <div class="KillmailListContent">
    @if (isKill){
        <div id="tokillsvalueList">
            <div class="topkillsvalueheader gradientheader"><img id="value" src alt/><label>@Labels.last_ten_expensive_kills</label></div>
            <div id="topkillsvaluecontainer" class="topkillsvaluecontainer"></div>
        </div>
    }
    <div id="killmails">
        <img id="listLoading" src alt width="16px" height="11px"/>
    </div>
    </div>
    <div class="rightContent">
        @if (isKill){
            <div class="topViewContainer">
                <div class="overlay hidden" id="topCharacterKillsMonthContentOverlay" ><img class="imgLoading" src alt width="16px" height="11px"/></div>
                <div class="topViewLabel gradientheader">@string.Format(Thread.CurrentThread.CurrentCulture, Labels.month_top_killers, DateTime.Today.ToString("MMMM"))</div>
                <div class="topViewlistContent" id="topCharacterKillsMonthContent"><img id="topCharacterKillsMonthContentLoading" src alt width="16px" height="11px"/></div>
            </div>
            <div class="topViewContainer">
                <div class="overlay hidden" id="topCharacterKillsWeekContentOverlay" ><img class="imgLoading" src alt width="16px" height="11px"/></div>
                <div class="topViewLabel gradientheader">@string.Format(Thread.CurrentThread.CurrentCulture, Labels.week_top_killers, week)</div>
                <div class="topViewlistContent" id="topCharacterKillsWeekContent"><img id="topCharacterKillsWeekContentLoading" src alt width="16px" height="11px"/></div>
            </div>
            <div class="topViewContainer">
                <div class="overlay hidden" id="topCharacterKillsMonthValueContentOverlay" ><img class="imgLoading" src alt width="16px" height="11px"/></div>
                <div class="topViewLabel gradientheader">@string.Format(Thread.CurrentThread.CurrentCulture, Labels.month_top_killers_value, DateTime.Today.ToString("MMMM"))</div>
                <div class="topViewlistContent" id="topCharacterKillsMonthValueContent"><img id="topCharacterKillsMonthValueContentLoading" src alt width="16px" height="11px"/></div>
            </div>
            <div class="topViewContainer">
                <div class="overlay hidden" id="topCorporationsKillsMonthContentOverlay" ><img class="imgLoading" src alt width="16px" height="11px"/></div>
                <div class="topViewLabel gradientheader">@string.Format(Thread.CurrentThread.CurrentCulture, Labels.month_top_corps, DateTime.Today.ToString("MMMM"))</div>
                <div class="topViewlistContent" id="topCorporationsKillsMonthContent"><img id="topCorporationsKillsMonthContentLoading" src alt width="16px" height="11px"/></div>
            </div>
            <div class="topViewContainer">
                <div class="overlay hidden" id="topCorporationsKillsWeekContentOverlay" ><img class="imgLoading" src alt width="16px" height="11px"/></div>
                <div class="topViewLabel gradientheader">@string.Format(Thread.CurrentThread.CurrentCulture, Labels.week_top_corps, week)</div>
                <div class="topViewlistContent" id="topCorporationsKillsWeekContent"><img id="topCorporationsKillsWeekContentLoading" src alt width="16px" height="11px"/></div>
            </div>
            <div id="topRegionMonth" class="topViewContainer">
                <div class="topRegionsLabel">@Labels.top_regions</div>
                <img id="topRegionMonthLoading" src alt width="16px" height="11px"/>
            </div>
            <div id="topRegionWeek" class="topViewContainer">
                <div class="topRegionsLabel">@Labels.top_regions</div>
                <img id="topRegionWeekLoading" src alt width="16px" height="11px"/>
            </div>
        }
        else{
            <div class="topViewContainer">
                <div class="topViewLabel gradientheader">@string.Format(Thread.CurrentThread.CurrentCulture, Labels.month_top_losers, DateTime.Today.ToString("MMMM"))</div>
                <div class="topViewlistContent" id="topCharacterLossesMonthContent"><img id="topCharacterLossesMonthContentLoading" src alt width="16px" height="11px"/></div>
            </div>
            <div class="topViewContainer">
                <div class="topViewLabel gradientheader">@string.Format(Thread.CurrentThread.CurrentCulture, Labels.week_top_losers, week)</div>
                <div class="topViewlistContent" id="topCharacterLossesWeekContent"><img id="topCharacterLossesWeekContentLoading" src alt width="16px" height="11px"/></div>
            </div>
            <div class="topViewContainer">
                <div class="topViewLabel gradientheader">@string.Format(Thread.CurrentThread.CurrentCulture, Labels.month_top_corp_losers, DateTime.Today.ToString("MMMM"))</div>
                <div class="topViewlistContent" id="topCorporationLossesMonthContent"><img id="topCorporationLossesMonthContentLoading" src alt width="16px" height="11px"/></div>
            </div>
            <div class="topViewContainer">
                <div class="topViewLabel gradientheader">@string.Format(Thread.CurrentThread.CurrentCulture, Labels.week_top_corp_losers, week)</div>
                <div class="topViewlistContent" id="topCorporationLossesWeekContent"><img id="topCorporationLossesWeekContentLoading" src alt width="16px" height="11px"/></div>
            </div>
        }
    </div>
</div>
@section scripts {
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"> </script>
    @if (isKill){
        <script type="text/javascript" >
            $(document).ready(function () {
                evekillboard
                    .loadKills(@Html.Raw(string.Format("'{0}',0",Url.Action("Kills","Killboard"))))
                    .appendResult(@Html.Raw(string.Format("'{0}'",Url.Action("TopKillsValueView","Killboard"))), 'topkillsvaluecontainer', null)
                    .appendResult(@Html.Raw(string.Format("'{0}'",Url.Action("TopCharactersKillsMonth","Killboard"))), 'topCharacterKillsMonthContent', { year: @DateTime.UtcNow.Year, month: @DateTime.UtcNow.Month })
                    .appendResult(@Html.Raw(string.Format("'{0}'",Url.Action("TopCharactersKillsWeek","Killboard"))), 'topCharacterKillsWeekContent', { year: @DateTime.UtcNow.Year, month: @DateTime.UtcNow.Month,week: @week  })
                    .appendResult(@Html.Raw(string.Format("'{0}'",Url.Action("TopCharactersKillsValueMonth","Killboard"))), 'topCharacterKillsMonthValueContent', { year: @DateTime.UtcNow.Year, month: @DateTime.UtcNow.Month })
                    .appendResult(@Html.Raw(string.Format("'{0}'",Url.Action("TopCorporationsKillsMonth","Killboard"))), 'topCorporationsKillsMonthContent', { year: @DateTime.UtcNow.Year, month: @DateTime.UtcNow.Month })
                    .appendResult(@Html.Raw(string.Format("'{0}'",Url.Action("TopCorporationsKillsWeek","Killboard"))), 'topCorporationsKillsWeekContent', { year: @DateTime.UtcNow.Year, month: @DateTime.UtcNow.Month, week: @week })
                    .appendResult(@Html.Raw(string.Format("'{0}'",Url.Action("TopMonthRegionsKill","Killboard"))), 'topRegionMonth', { year: @DateTime.UtcNow.Year, month: @DateTime.UtcNow.Month })
                    .appendResult(@Html.Raw(string.Format("'{0}'",Url.Action("TopWeekRegionsKills","Killboard"))), 'topRegionWeek', { year: @DateTime.UtcNow.Year, month: @DateTime.UtcNow.Month, week: @week });
            });
        </script>
    }
    else{
        <script type="text/javascript" >
            $(document).ready(function () {
                evekillboard
                    .loadKills(@Html.Raw(string.Format("'{0}',0",Url.Action("Losses","Killboard"))))
                    .appendResult(@Html.Raw(string.Format("'{0}'",Url.Action("TopCharactersLossesMonth","Killboard"))), 'topCharacterLossesMonthContent', { year: @DateTime.UtcNow.Year, month: @DateTime.UtcNow.Month })
                    .appendResult(@Html.Raw(string.Format("'{0}'",Url.Action("TopCharactersLossesWeek","Killboard"))), 'topCharacterLossesWeekContent', { year: @DateTime.UtcNow.Year, month: @DateTime.UtcNow.Month, week: @week })
                    .appendResult(@Html.Raw(string.Format("'{0}'",Url.Action("TopCorporationsLossesMonth","Killboard"))), 'topCorporationLossesMonthContent', { year: @DateTime.UtcNow.Year, month: @DateTime.UtcNow.Month })
                    .appendResult(@Html.Raw(string.Format("'{0}'",Url.Action("TopCorporationsLossesWeek","Killboard"))), 'topCorporationLossesWeekContent', { year: @DateTime.UtcNow.Year, month: @DateTime.UtcNow.Month });
            });
        </script>
    }
}
